﻿using OPM.Models;
using OPM.ServiceListOfValues;

namespace OPM.Class
{
    public static class WSL
    {
        #region ListOfValues Service

        public static CaseObjective[] GetCaseObjective()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCaseObjective(U.IsThai);
            CaseObjective[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<CaseObjective[]>(resultStr);
            return result;
        }

        public static CaseStatus[] GetCaseStatus()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCaseStatus(U.IsThai);
            CaseStatus[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<CaseStatus[]>(resultStr);
            return result;
        }

        public static CaseTerminalType[] GetCaseTerminalType(string org_id, string ref_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCaseTerminalType(org_id, ref_id, U.IsThai);
            CaseTerminalType[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<CaseTerminalType[]>(resultStr);
            return result;
        }

        public static CaseType[] GetCaseType(string ref_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCaseType(ref_id, U.IsThai);
            CaseType[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<CaseType[]>(resultStr);
            return result;
        }

        public static CaseTypeOrgOwner[] GetCaseTypeOrgOwner(string case_type_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCaseTypeOrgOwner(case_type_id, U.IsThai);
            CaseTypeOrgOwner[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<CaseTypeOrgOwner[]>(resultStr);
            return result;
        }

        public static ChannelIn[] GetChannelIn(string ref_id, string org_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetChannelIn(ref_id, org_id, U.IsThai);
            ChannelIn[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<ChannelIn[]>(resultStr);
            return result;
        }

        public static ChannelOut[] GetChannelOut(string ref_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetChannelOut(ref_id, U.IsThai);
            ChannelOut[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<ChannelOut[]>(resultStr);
            return result;
        }

        public static ContactObjective[] GetContactObjective(string ref_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetContactObjective(ref_id, U.IsThai);
            ContactObjective[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<ContactObjective[]>(resultStr);
            return result;
        }

        public static ContentType[] GetContentType()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetContentType(U.IsThai);
            ContentType[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<ContentType[]>(resultStr);
            return result;
        }

        public static Country[] GetCountry()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetCountry(U.IsThai);
            Country[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Country[]>(resultStr);
            return result;
        }

        public static District[] GetDistricts(string province_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetDistricts(province_id, U.IsThai);
            District[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<District[]>(resultStr);
            return result;
        }

        public static DocumentType[] GetDocumentType()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetDocumentType(U.IsThai);
            DocumentType[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<DocumentType[]>(resultStr);
            return result;
        }

        public static Gender[] GetGender()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetGender(U.IsThai);
            Gender[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Gender[]>(resultStr);
            return result;
        }

        public static MobileCaseObjective[] GetMobileCaseObjective()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetMobileCaseObjective(U.IsThai);
            MobileCaseObjective[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<MobileCaseObjective[]>(resultStr);
            return result;
        }
        public static MobileContactObjective[] GetMobileContactObjective()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetMobileContactObjective(U.IsThai);
            MobileContactObjective[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<MobileContactObjective[]>(resultStr);
            return result;
        }
        public static OperatingStatus[] GetOperatingStatus()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetOperatingStatus(U.IsThai);
            OperatingStatus[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<OperatingStatus[]>(resultStr);
            return result;
        }

        public static OperatingType[] GetOperatingType(string ref_id, bool is_coorperate)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetOperatingType(ref_id, is_coorperate, U.IsThai);
            OperatingType[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<OperatingType[]>(resultStr);
            return result;
        }

        public static Organization[] GetOrganization(string ref_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetOrganization(ref_id, U.IsThai);
            Organization[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Organization[]>(resultStr);
            return result;
        }

        public static Priority[] GetPriority()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetPriority(U.IsThai);
            Priority[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Priority[]>(resultStr);
            return result;
        }

        public static Province[] GetProvinces()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetProvinces(U.IsThai);
            Province[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Province[]>(resultStr);
            return result;
        }

        public static Secret[] GetSecret()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetSecret(U.IsThai);
            Secret[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Secret[]>(resultStr);
            return result;
        }

        public static Severity[] GetSeverity()
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetSeverity(U.IsThai);
            Severity[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<Severity[]>(resultStr);
            return result;
        }

        public static SubDistrict[] GetSubDistricts(string district_id)
        {
            var s = new ListOfValuesSoapClient();
            var resultStr = s.GetSubDistricts(district_id, U.IsThai);
            SubDistrict[] result = Newtonsoft.Json.JsonConvert.DeserializeObject<SubDistrict[]>(resultStr);
            return result;
        }

        #endregion


    }
}